#pragma once

#include<vector>

#include"Group.h"

using std::vector;

class State
{
public:
	bool GotWinner() const
	{
		int amountOfMyUnits = 0;
		int amountOfEnemyUnits = 0;
		for(int whichUnit = 0 ; whichUnit < MyGroup.Units.size() ; ++whichUnit)
		{
			if(MyGroup.Units[whichUnit].Alive())
			{
				++amountOfMyUnits;
			}
		}
		for(int whichUnit = 0 ; whichUnit < EnemyGroup.Units.size() ; ++whichUnit)
		{
			if(EnemyGroup.Units[whichUnit].Alive())
			{
				++amountOfEnemyUnits;
			}
		}

		if(amountOfMyUnits <= 0 || amountOfEnemyUnits <= 0)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	void Clear()
	{
		MyGroup.Clear();
		EnemyGroup.Clear();
	}
	//--
	Group MyGroup;
	Group EnemyGroup;

};